module(
    name = "rules_proto_grpc_java",
    version = "5.2.1",
    compatibility_level = 1,
)

bazel_dep(name = "rules_java", version = "8.12.0")
bazel_dep(name = "rules_jvm_external", version = "6.7")
bazel_dep(name = "rules_proto_grpc", version = "5.2.1")

download_plugins = use_extension("//:module_extensions.bzl", "download_plugins")
use_repo(
    download_plugins,
    "grpc_java_plugin_darwin_arm64",
    "grpc_java_plugin_darwin_x86_64",
    "grpc_java_plugin_linux_arm64",
    "grpc_java_plugin_linux_x86_64",
    "grpc_java_plugin_windows_x86_64",
)

maven = use_extension("@rules_jvm_external//:extensions.bzl", "maven")
maven.install(
    name = "rules_proto_grpc_java_maven",  # Deconflict
    artifacts = [
        "com.google.protobuf:protobuf-java:4.31.1",
        "com.google.protobuf:protobuf-java-util:4.31.1",
        "io.grpc:grpc-api:1.72.0",
        "io.grpc:grpc-netty:1.72.0",
        "io.grpc:grpc-protobuf:1.72.0",
        "io.grpc:grpc-stub:1.72.0",
        "javax.annotation:javax.annotation-api:1.3.2",
    ],
    strict_visibility = True,
)
use_repo(maven, "rules_proto_grpc_java_maven")
